package org.gd.hellojson.locale;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.SerializerProvider;

import java.io.IOException;

/**
 * @author Gorhover
 * @version 1.0-SNAPSHOT
 * @since 2013-11-07 18:19
 */
class JS extends JsonSerializer<String> {

    @Override
    public void serialize(String value, JsonGenerator jgen, SerializerProvider provider)
            throws IOException {
        if(provider instanceof ObjectHolder) {
            ObjectHolder objectHolder = (ObjectHolder) provider;
            System.out.println(objectHolder.getObject());
        }
        jgen.writeString("{" + value + "}");
    }
}
